package com.enfi.api.modules.bz.controller;

import com.enfi.api.domain.res.ApiResult;
import com.enfi.api.modules.bz.service.CockpitService;
import com.enfi.api.modules.db.entity.UserCockpitConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author wind
 * @date 2020/4/10
 */
@RestController
@RequestMapping("cockpit")
public class CockpitController {
    @Autowired
    private CockpitService cockpitService;

    @GetMapping(value = {"getCockpitIndexList"})
    public Object getCockpitIndexList(Integer cockpitType,Integer platformType){
        return ApiResult.renderOk().add(cockpitService.getCockpitIndexList(cockpitType,platformType));
    }
    @PostMapping(value = {"updateUserConfig"})
    public Object updateUserConfig(@RequestBody List<UserCockpitConfig> userCockpitConfigList){
        cockpitService.updateUserConfig(userCockpitConfigList);
        return ApiResult.renderOk();
    }

}
